﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using MEF_Test.Bricks.Mediator;
using MEF_Test.Contracts;
using System.Windows.Input;

namespace PartTwo
{
    [Export(typeof(IModuleThumbnail))]
    public class PartTwoViewModel : IModuleThumbnail
    {
        public PartTwoViewModel()
        {
            ModuleActivationCommand = new ParameterlessCommand(executeModuleActivated, canExecuteModuleActivation);
            Caption = "Part Two";
        }

        private bool canExecuteModuleActivation()
        {
            return true;
        }

        private void executeModuleActivated()
        {
            Mediator<LoadModuleMediation>.Publish(new LoadModuleMediation
                                                      {
                                                          ModuleUri =new Uri("/PartTwo;component/MainScreen.xaml",UriKind.Relative)
                                                      });
        }

        public string Caption { get; set; }
     
        public ICommand ModuleActivationCommand { get; set; }

       
    }
}
